<?php

use Illuminate\Database\Migrations\Migration;

class Productattributes extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		//
		// Create products table
		Schema::create("product_attributes", function($table)
		{
			// identifiers
			$table->increments("id");
			$table->text("attributename");
			
			// soft deletes
			$table->softDeletes();
			
			// timestamps
			$table->timestamps();
		});
		
		Schema::create("product_product_attributes", function($table)
		{
			// identifiers
			$table->increments("id");
			$table->integer("productid");
			$table->integer("productattributeid");
			$table->text("content")->nullable();
			
			// soft deletes
			$table->softDeletes();
			
			// timestamps
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		//
		Schema::drop("product_attributes");
		Schema::drop("product_product_attributes");
	}

}